package com.ssfeng.youxia;

/**
 * @Description:
 * @Author: liyuhang
 * @CreateTime: 2021/1/10 11:57 下午
 * @Company:
 */
public class Singleton {

    private volatile static Singleton uniqueInstance;

    private Singleton() {

    }

    public static Singleton getInstance(){
        if (uniqueInstance == null) {
            synchronized (Singleton.class) {
                if (uniqueInstance == null) {
                    uniqueInstance = new Singleton();
                }
            }
        }
        return uniqueInstance;
    }
}
